how to determine the location of a specific element in a matrix in matlab